package leetcode;

import java.util.HashSet;
import java.util.Arrays;

public class Q2465 {
    public int distinctAverages(int[] nums) {
        HashSet<Integer> set = new HashSet<Integer>();
        Arrays.sort(nums);
        for (int i = 0, j = nums.length - 1; i < j; ++i, --j) {
            set.add(nums[i] + nums[j]);
        }
        return set.size();
    }

    public static void main(String[] args) {
        Q2465 sl = new Q2465();
        int[] nums = {4, 1, 4, 0, 3, 5};
        System.out.println(sl.distinctAverages(nums));
    }
}